﻿using DM_Sqlite.MappingClass;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DM_Sqlite.MappingClassConfig
{
    internal class dm_props_admin_config : IEntityTypeConfiguration<dm_props_admin>
    {
        public void Configure(EntityTypeBuilder<dm_props_admin> builder)
        {
            builder.ToTable("dm_props_admin");
            builder.HasKey(b => b.key);
            builder.Property(a => a.sample).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.points).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.reducetimes).HasColumnType("tinyint(2)").IsRequired();
            builder.Property(a => a.intervaltime).HasColumnType("tinyint(2)").IsRequired();
            builder.Property(a => a.logintervaltime).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.smtpport).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.timespan).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.accerrorvalue).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.diserrorvalue).HasColumnType("smallint(5)").IsRequired();
            builder.Property(a => a.fromemail).HasMaxLength(255).IsRequired();
            builder.Property(a => a.smtaddress).HasMaxLength(255).IsRequired();
            builder.Property(a => a.subject).HasMaxLength(255).IsRequired();
            builder.Property(a => a.modeltext).HasMaxLength(255).IsRequired();
            builder.Property(a => a.autorizedkey).HasMaxLength(255).IsRequired();
            builder.Property(a => a.logkeywords).HasMaxLength(500).IsRequired();
        }
    }
}
